package ch10.test;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class ArrayListClass {

	public static void main(String[] args) {
		List list = new ArrayList();
		list.add(2);
		list.add(1);
		list.add(5);
		list.add(4);
		list.add(3);

		System.out.println("排序前：");

		System.out.println(list);

		System.out.println("排序后：");
		Collections.sort(list);
		System.out.println(list);
		
		for(Object object:list) {
			System.out.println(object);
		}
	}

}
